import { Component, OnInit } from '@angular/core';
import { AccountService } from './../services/account';

@Component({
  selector: 'ree-authority',
  templateUrl: './authority.component.html',
  styleUrls: ['./authority.component.scss']
})
export class AuthorityComponent implements OnInit {

  constructor(private accountService: AccountService) { }

  authoritySetting = [];
  selectedMultipleOption;
  searchOptions;
  isVisible:boolean=false;

  ngOnInit() {
    this.searchOptions = [
      { label: '产品设置', value: '产品设置' },
      { label: '预警设置', value: '预警设置' },
      { label: '设备列表', value: '设备列表' }
    ];
    this.getAuthorityList()
  }

  getAuthorityList() {
    this.accountService.getAuthorityList().then(data => this.authoritySetting = data)

    this.selectedMultipleOption = ['产品设置'];
  }

  createLevel(){
    this.isVisible = true;
  }

  cancelCreateLevel(){
    this.isVisible = false;
  }

  confirmCreateLevel(){
    this.isVisible = false;
  }


}
